1. Field of the Invention
The present invention generally relates to a motion-adaptive image signal processing system and, more particularly, to a motion image compression apparatus which is suitably used in compression coding of a motion image such as an ultrasonic diagnostic image whose motion region in a screen is limited in a compression coding apparatus for compressing digital motion image data.
The present invention also relates to an image signal decoding apparatus for decoding an image which is transmitted or recorded after it is subjected to high-efficiency coding.
Furthermore, the present invention relates to a motion image coding apparatus suitable for a motion image such as an ultrasonic diagnostic image whose motion region and moving direction in a screen are limited in a compression coding apparatus for compressing digital motion image data.
2. Description of the Related Art
When a motion image signal picked up by a solid-state image pickup device represented by a charge-coupled device (CCD) is recorded as digital data on a storage device such as a magnetic disk, a magnetic tape, or the like, its data amount becomes very large. For this reason, when such a motion image signal is to be recorded within a limited storage capacity range, data of the picked-up image signal must be compressed with high efficiency by some technique.
As a motion image compression method, a technique for achieving a high compression ratio by utilizing an inter-frame correlation proposed by the International Organization for Standardization (ISO) is normally used. This technique will be briefly described below with reference to FIG. 25.
FIG. 25 is a block diagram showing a conventional motion image compression technique utilizing an inter-frame correlation.
Referring to FIG. 25, a predicted error signal obtained by subtracting a motion-compensated inter-frame predicted image signal from an input image signal by a differential circuit 1 is subjected to DCT (discrete cosine transform) in units of blocks by a DCT circuit 2. Thereafter, the transformed signal is quantized by a quantization circuit 3. Furthermore, a variable length code is assigned to the quantization result by a coding circuit 4, and the coded result is recorded on a recording medium (not shown) or transmitted to an external device. The quantization result is decoded by an inverse quantization circuit 5 and an inverse DCT circuit 6, and the decoded signal is added to the motion-compensated inter-frame predicted image signal by an addition circuit 7. A motion vector is calculated by a motion-compensated prediction circuit 8 which incorporates an image memory having a motion-compensation variable delay function, thereby generating a motion-compensated inter-frame predicted image signal for the next frame.
All frames are compressed by repeating the above-mentioned series of processing operations. In this case, a difference is not always coded, but an input image signal itself is coded, and such a coded image is called an "I picture". Predicted error image signals include the following two different signals.
One predicted error signal is called a "P picture", and a difference between an image signal to be coded and an image signal of an I or P picture which is temporally located before the image signal to be coded and has already been coded is calculated. In practice, one, having higher efficiency, of a method of coding a difference from a motion-compensated predicted image signal and a so-called intra-coding method for coding a signal without calculating a difference is selected.
The other predicted error signal is called a "B picture", and one, having the highest efficiency, of methods of respectively coding three different differences from an image signal temporally located before an image signal to be coded, an image signal temporally located after the image signal to be coded, and an interpolated image signal generated from image signals temporally before and after the image signal to be coded, and intra-coding is selected. This prediction method can be switched in units of blocks, and selection information is added to a code as a block type.
In a signal which is motion-compensated to lower redundancy in the time-base direction by calculating a difference between adjacent images, DCT and variable length coding are used to lower redundancy in the space direction. A coding technique utilizing orthogonal transform such as DCT is also widely used in compression of a still image signal. This technique will be described below with reference to FIG. 26.
FIG. 26 is a diagram for explaining compression operation processing of a still image signal by a coding technique utilizing the DCT. When a signal f whose redundancy in the time-base direction is lowered is input (S101), the input image data f is divided into blocks each having a predetermined size so as to obtain data f.sub.b (S102). Two-dimensional DCT as orthogonal transform is performed in units of divided blocks, thus transforming data f.sub.b into data F (S103). Then, the transformed data F is subjected to linear quantization in accordance with frequency components (S104), and a quantized value F.sub.Q is subjected to Huffman coding as variable length coding (S105). The coded result is transmitted or recorded as compressed data C. At this time, a quantization matrix which represents relative quantization characteristics in consideration of visual characteristics with respect to the respective frequency components is prepared, and the quantization step size of the linear quantization is determined by multiplying the quantization matrix with a constant.
On the other hand, when image data is reproduced from the compressed data, the variable length code (C) is decoded to obtain the quantized value F.sub.Q of the transform coefficient (S106). However, it is impossible to obtain the true value F before quantization from this value, and a result obtained by inverse quantization is F' including an error (S107). Therefore, IDCT (inverse discrete cosine transform) is performed for this value (F') (S108), and the transformed value f.sub.b ' is subjected to inverse-block processing (S109). As a result, the obtained image data f' includes an error.
Therefore, the image quality of the reproduced image f' which is reproduced and output deteriorates. More specifically, the error of the value (F') as a result of inverse quantization deteriorates image quality of the reproduced image (f') as a so-called quantization error.
This will be described in more detail below. First, input image data is divided into blocks each having a predetermined size (e.g., a block consisting of 8.times.8 pixels), and each divided block is subjected to two-dimensional DCT as orthogonal transform. The transform result is sequentially stored on an 8.times.8 matrix.
Upon observation on a two-dimensional plane, image data has a spatial frequency as frequency information based on the distribution of density information. Therefore, when the DCT is performed, image data is transformed into DC and AC components, and data indicating the value of the DC component is stored at the origin position (0, 0) on the 8.times.8 matrix. Then, data indicating the maximum frequency of the AC component in the abscissa direction is stored at a position (0, 7), data indicating the maximum frequency of the AC component in the ordinate direction is stored at a position (7, 0), and data indicating the maximum frequency of the AC component in the oblique direction is stored at a position (7, 7). At intermediate positions, frequency data in directions associated with their coordinate positions are stored, so that data having higher frequencies sequentially appear from the origin side.
Then, when data stored at each coordinate position on this matrix is divided by the quantization step size corresponding to each frequency component, linear quantization is performed in correspondence with the frequency components, and Huffman coding is performed as variable length coding for the quantized value. At this time, as for the DC component, a difference between itself and a DC component in a neighboring block is Huffman-coded. As for AC components, a scanning operation, called a zigzag scanning operation, is performed from a lower frequency component to a higher frequency component, and the numbers of continuous invalid components (having a value "0") (the run number of zeros) and the subsequent valid component values are two-dimensionally Huffman-coded, thus obtaining coded data.
A motion image compression method (to be referred to as inter-frame coding hereinafter) which utilizes an inter-frame correlation such as a P picture, a B picture, and the like is a very effective compression method when an inter-frame correlation is high, i.e., when the contents of images between adjacent frames undergo almost no change. However, when patterns significantly change (contents of images are switched) between adjacent frames like in a scene change, compression efficiency is impaired due to an increase in inter-frame error.
Jpn. Pat. Appln. KOKAI Publication No. 3-250887 discloses a countermeasure against a scene change upon execution of inter-frame coding. More specifically, a scene change is detected on the basis of an inter-frame difference, and upon detection of the scene change, a compression method (to be referred to as intra-frame coding hereinafter) which utilizes only an intra-frame correlation like the I picture is executed, thus preventing coding efficiency from being impaired.
However, when coding is performed at a predetermined rate, if intra-frame coding is performed every time a scene change occurs, since the code amount generated by intra-frame coding is normally considerably larger than that generated by inter-frame coding to be executed other than a scene change, a code amount which can be used in inter-frame coding after intra-frame coding is limited to a very small amount.
This means a considerably high compression ratio in a frame to be subjected to inter-frame coding after intra-frame coding executed upon detection of a scene change. As a result, the quantization step size becomes large, and a quantization error causes deterioration of image quality such as the above-mentioned block distortion. Furthermore, since the subsequent inter-frame coded frames use the image, whose image quality has deteriorated, as a reference image, deterioration of image quality continues over several frames.
In this technique, the compression ratio is normally controlled by changing the quantization step size of the quantization. As the compression ratio increases, the quantization step size becomes larger. Therefore, the quantization error becomes large, and deterioration of image quality of a reproduced image becomes conspicuous.
The quantization error of the transform coefficient tends to appear as a so-called block distortion (discontinuity generated at a block boundary portion in a reproduced image) or mosquito noise (a fog-like pattern appearing on a flat portion near an edge). Since these distortions are visually conspicuous, subjective impression of the reproduced image given to a person who observes the image is bad even when the S/N ratio is good.
Thus, a technique for filtering an image reproduced by a decoder using a low-pass filter as distortion removal processing has been proposed. This filtering technique can relatively satisfactorily remove a distortion. However, when an image includes an edge, the edge is blurred. Conversely, when the degree of low-pass filtering is lowered to eliminate blurring, the block distortion cannot be perfectly removed.
In order to eliminate this drawback, a technique for detecting the presence/absence of an edge and a distortion in an image, selecting a portion to be filtered in accordance with the detection result, and filtering only a portion including a distortion is also proposed.
However, in the distortion removal technique described in the prior art, a drawback of blurring in an image still remains unsolved, and a block distortion amount, or the like must be calculated, thus requiring a long processing time. For this reason, the circuit scale and power consumption become very large. Therefore, it is difficult to apply the above-mentioned technique to a product which places an importance on a compact structure and high-speed processing, especially, a product which processes a motion image.
As described above, in compression coding of a motion image by a conventional motion image coding apparatus, the technique for dividing frames to those subjected to intra-frame coding and those subjected to inter-frame coding is popularly used.
The intra-frame coding is a technique for independently performing DCT of an input image frame in units of blocks each consisting of 8.times.8 pixels to quantize transform coefficients, and then performing variable length coding of the quantized value.
On the other hand, the inter-frame coding is the following technique. That is, in order to reduce a decrease in redundancy in the time-base direction due to a motion between an input image frame and a decoded image of the immediately preceding frame, a motion vector is detected in units of blocks each consisting of n.times.m pixels (e.g., 16.times.16 pixels), and a motion is compensated in units of blocks. Furthermore, in the inter-frame coding, a difference is calculated between a motion-compensated predicted image and an input image, and DCT is performed in units of blocks each including, e.g., 8.times.8 pixels to quantize transform coefficients. Thereafter, the quantized value is subjected to variable length coding.
Such compression coding allows compression with high efficiency, it is adopted in H. 261 as the international standards of television radio waves, and MPEG (Motion Picture Experts Group) as the international standards of storage media.
However, the compression coding by the above-mentioned motion image coding apparatus basically uses DCT in units of blocks. For this reason, when a high compression ratio is to be attained, since it is controlled to increase the quantization step size of the DCT coefficients, the quantization error increases, and as a result, discontinuity at the block boundaries in a decoded image becomes conspicuous. This deterioration is generally called a block distortion.
In particular, when an image obtained from an ultrasonic diagnostic apparatus is compressed by such a compression technique using DCT, a block distortion appears more conspicuously than a normal image.